home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
clean
/
sun3.lha
/
Sun3
/
deltaMira.abc
< prev
next >
Wrap
Text File
|
1992-08-07
|
4KB
|
239 lines
.comp 800 111111011
.code 141 4 15
.start _nostart_
.endinfo
.implab _cycle_in_spine
.implab _reserve
.implab _type_error
.impdesc _Defer
.implab _defer_code
.implab _hnf
.impdesc _Cons
.impdesc _Tuple
.impdesc _Select
.impdesc _Nil
.implab _driver
.implab e_system_nAP
.implab e_system_sAP
.impdesc e_system_AP
.desc m_deltaMira _hnf _hnf 0 "deltaMira"
.export e_deltaMira_EQUAL
.export e_deltaMira_sEQUAL
.export e_deltaMira_nEQUAL
.desc e_deltaMira_EQUAL e_deltaMira_nEQUAL e_deltaMira_lEQUAL 2 "EQUAL"
.o 2 0
e_deltaMira_lEQUAL:
repl_args 1 1
.d 2 0
jsr eaEQUAL
.o 0 1 b
create
fillB_b 0 0
pop_b 1
.d 1 0
rtn
.n 2 e_deltaMira_EQUAL
.o 1 0
e_deltaMira_nEQUAL:
push_node _reserve 2
.d 2 0
jsr eaEQUAL
.o 0 1 b
getWL 0
fillB_b 0 0
release
pop_b 1
.d 1 0
rtn
.o 2 0
eaEQUAL:
|| y
push_a 1
jsr_eval
pop_a 1
|| x
jsr_eval
|| y
|| x
.o 2 0
e_deltaMira_sEQUAL:
.o 2 0
sEQUAL.1:
|| Match code for alternative 1, stacksizes A: 2 B: 0
|| Building the contractum, Stacksizes A: 2 B: 0
==: eq_symbol 0 1 | compare the descriptors
jmp_false ==exitFalse
get_node_arity 0 | push the node arity on bstack
push_b 0 | and copy it (the argnumber)
==argumentevalloop:
eqI_b 0 0 | check if all arguments are
jmp_true ==compare | evaluated. If so, start comparing.
push_b 1
push_b 1
push_arg_b 0 | push a couple of arguments
jsr_eval | on top of the a-stack and
pop_a 1
push_b 1
push_b 1
push_arg_b 1 | evaluate them.
jsr_eval
pop_a 1
decI | decrease the argument number and
jmp ==argumentevalloop | evaluate the rest of the arguments.
==compare:
update_b 1 0 | reset the argument number
==compareloop:
eqI_b 0 0 | check if all arguments are
jmp_true ==exitTrue | compared. If so, exit to True.
push_b 1
push_b 1
push_arg_b 0 | push a couple of arguments
push_b 1
push_b 1
push_arg_b 2 | on the stack and
.d 2 0
jsr == | compare them.
.o 0 1 b
jmp_false ==exitFalse2
decI | decrease the argument number and
jmp ==compareloop | compare the rest of the arguments.
==exitFalse2:
pop_b 2
==exitFalse:
pop_a 2
pushB FALSE
.d 0 1 b
rtn
==exitTrue:
pop_b 2
pop_a 2
pushB TRUE
.d 0 1 b
rtn
.inline EQUAL
.d 2 0
jsr e_deltaMira_sEQUAL
.o 0 1 b
.end
.d 0 1 b
rtn
.export e_deltaMira_NOTEQUAL
.export e_deltaMira_sNOTEQUAL
.export e_deltaMira_nNOTEQUAL
.desc e_deltaMira_NOTEQUAL e_deltaMira_nNOTEQUAL e_deltaMira_lNOTEQUAL 2 "NOTEQUAL"
.o 2 0
e_deltaMira_lNOTEQUAL:
repl_args 1 1
.d 2 0
jsr eaNOTEQUAL
.o 0 1 b
create
fillB_b 0 0
pop_b 1
.d 1 0
rtn
.n 2 e_deltaMira_NOTEQUAL
.o 1 0
e_deltaMira_nNOTEQUAL:
push_node _reserve 2
.d 2 0
jsr eaNOTEQUAL
.o 0 1 b
getWL 0
fillB_b 0 0
release
pop_b 1
.d 1 0
rtn
.o 2 0
eaNOTEQUAL:
|| y
push_a 1
jsr_eval
pop_a 1
|| x
jsr_eval
|| y
|| x
.o 2 0
e_deltaMira_sNOTEQUAL:
.o 2 0
sNOTEQUAL.1:
|| Match code for alternative 1, stacksizes A: 2 B: 0
|| Building the contractum, Stacksizes A: 2 B: 0
.d 2 0
jsr ==
.o 0 1 b
notB
.d 0 1 b
rtn
.inline NOTEQUAL
.d 2 0
jsr e_deltaMira_sNOTEQUAL
.o 0 1 b
.end
.d 0 1 b
rtn
.export e_deltaMira_UNDRESS
.export e_deltaMira_sUNDRESS
.export e_deltaMira_nUNDRESS
.desc e_deltaMira_UNDRESS e_deltaMira_nUNDRESS e_deltaMira_lUNDRESS 1 "UNDRESS"
.o 2 0
e_deltaMira_lUNDRESS:
update_a 1 0
create
update_a 0 2
pop_a 1
.d 2 0
jmp eaUNDRESS
.n 1 e_deltaMira_UNDRESS
.o 1 0
e_deltaMira_nUNDRESS:
push_node _reserve 1
.o 2 0
eaUNDRESS:
|| x
jsr_eval
|| x
.o 2 0
e_deltaMira_sUNDRESS:
.o 2 0
sUNDRESS.1:
|| Match code for alternative 1, stacksizes A: 1 B: 0
|| Building the contractum, Stacksizes A: 1 B: 0
get_node_arity 0 | get the arity and
push_b 0 | push the argument number
create | create and
fill _Nil 0 _hnf 0 | fill the tail of the list
UND_loop:
eqI_b 0 0 | check if all args
jmp_true UND_ready | are handled
create
push_a 1
push_b 1
push_b 1
push_arg_b 3 | create and fill
fill _Cons 2 _hnf 2 | the next list element
update_a 0 1
pop_a 1
decI | decrease the argument number
jmp UND_loop | and continue with the other arguments
UND_ready:
create | create and fill the head with
fillS_symbol 2 0 | the string
getWL 3
fill _Cons 2 _hnf 3 | and fill the last element (root!)
release
pop_a 1
pop_b 2
.d 1 0
rtn
.inline UNDRESS
.d 2 0
jsr e_deltaMira_sUNDRESS
.o 1 0
.end
.d 1 0
rtn